﻿namespace EasyCMS.Common.DataComponents
{
    using System;
    using Pismire;

    ///<summary>
    ///EasyCMS
    ///</summary>
    ///<remarks>
    ///编写人: 唐炜
    ///编写时间 :2008-9-2
    ///修订历史
    ///---------------
    ///</remarks>
    [System.Runtime.Serialization.DataContractAttribute(Name = "Member", Namespace = "http://schemas.datacontract.org/2004/07/EasyCMS.Common.DataComponents")]
    public class Member : Pismire.Data.DBComponentBase
    {
        #region UserProviderName
        /// <summary>
        /// 
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string UserProviderName
        {
            get { return m_UserProviderName; }
            set { m_UserProviderName = value; }
        }
        private string m_UserProviderName;

        /// <summary>
        ///  正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState UserProviderName_Validate(ref string userProviderName)
        {
            return userProviderName.Validation("UserProviderName").LengthBetween(0, 255).Text(ValidationMode.Only).BindValue(ref userProviderName).State;
        }
        #endregion

        #region UserProviderKey
        /// <summary>
        /// 
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string UserProviderKey
        {
            get { return m_UserProviderKey; }
            set { m_UserProviderKey = value; }
        }
        private string m_UserProviderKey;

        /// <summary>
        ///  正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState UserProviderKey_Validate(ref string userProviderKey)
        {
            return userProviderKey.Validation("UserProviderKey").LengthBetween(0, 255).Text(ValidationMode.Only).BindValue(ref userProviderKey).State;
        }
        #endregion

        #region NickName
        /// <summary>
        /// 
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string NickName
        {
            get { return m_NickName; }
            set { m_NickName = value; }
        }
        private string m_NickName;

        /// <summary>
        ///  正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState NickName_Validate(ref string nickName)
        {
            return nickName.Validation("NickName").LengthBetween(0, 20).Text(ValidationMode.Only).BindValue(ref nickName).State;
        }
        #endregion

        #region RealName
        /// <summary>
        /// 真实姓名
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string RealName
        {
            get { return m_RealName; }
            set { m_RealName = value; }
        }
        private string m_RealName;

        /// <summary>
        /// 真实姓名 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState RealName_Validate(ref string realName)
        {
            return realName.Validation("RealName").LengthBetween(0, 20).Text(ValidationMode.Only).BindValue(ref realName).State;
        }
        #endregion

        #region Sex
        /// <summary>
        /// 性别
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public Pismire.ConstValues.Sex Sex
        {
            get { return m_Sex; }
            set { m_Sex = value; }
        }
        private Pismire.ConstValues.Sex m_Sex;
        #endregion

        #region Wedlock
        /// <summary>
        /// 婚姻状态
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public Pismire.ConstValues.Wedlock Wedlock
        {
            get { return m_Wedlock; }
            set { m_Wedlock = value; }
        }
        private Pismire.ConstValues.Wedlock m_Wedlock;
        #endregion

        #region Exp
        /// <summary>
        /// 经验值
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public int Exp
        {
            get { return m_Exp; }
            set { m_Exp = value; }
        }
        private int m_Exp;

        /// <summary>
        /// 经验值 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Exp_Validate(ref int exp)
        {
            return exp.Validation("Exp").MoreThan(0).State;
        }
        #endregion

        #region Score
        /// <summary>
        /// 积分
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public int Score
        {
            get { return m_Score; }
            set { m_Score = value; }
        }
        private int m_Score;

        /// <summary>
        /// 积分 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Score_Validate(ref int score)
        {
            return score.Validation("Score").MoreThan(0).State;
        }
        #endregion

        #region Work
        /// <summary>
        /// 工作信息
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Work
        {
            get { return m_Work; }
            set { m_Work = value; }
        }
        private string m_Work;

        /// <summary>
        /// 工作信息 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Work_Validate(ref string work)
        {
            return work.Validation("Work").LengthBetween(0, 50).Text(ValidationMode.Only).BindValue(ref work).State;
        }
        #endregion

        #region Face
        /// <summary>
        /// 头像
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Face
        {
            get { return m_Face; }
            set { m_Face = value; }
        }
        private string m_Face;

        /// <summary>
        /// 头像 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Face_Validate(ref string face)
        {
            return face.Validation("Face").LengthBetween(0, 255).Text(ValidationMode.Only).BindValue(ref face).State;
        }
        #endregion

        #region Photo
        /// <summary>
        /// 相片
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Photo
        {
            get { return m_Photo; }
            set { m_Photo = value; }
        }
        private string m_Photo;

        /// <summary>
        /// 相片 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Photo_Validate(ref string photo)
        {
            return photo.Validation("Photo").LengthBetween(0, 255).Text(ValidationMode.Only).BindValue(ref photo).State;
        }
        #endregion

        #region Phone
        /// <summary>
        /// 联系电话
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Phone
        {
            get { return m_Phone; }
            set { m_Phone = value; }
        }
        private string m_Phone;

        /// <summary>
        /// 联系电话 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Phone_Validate(ref string phone)
        {
            return phone.Validation("Phone").LengthBetween(0, 20).Text(ValidationMode.Only).BindValue(ref phone).State;
        }
        #endregion

        #region Mobile
        /// <summary>
        /// 移动电话
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Mobile
        {
            get { return m_Mobile; }
            set { m_Mobile = value; }
        }
        private string m_Mobile;

        /// <summary>
        /// 移动电话 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Mobile_Validate(ref string mobile)
        {
            return mobile.Validation("Mobile").LengthBetween(0, 20).Text(ValidationMode.Only).BindValue(ref mobile).State;
        }
        #endregion

        #region IM01
        /// <summary>
        /// 即时通讯工具1
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string IM01
        {
            get { return m_IM01; }
            set { m_IM01 = value; }
        }
        private string m_IM01;

        /// <summary>
        /// 即时通讯工具1 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState IM01_Validate(ref string iM01)
        {
            return iM01.Validation("IM01").LengthBetween(0, 300).Text(ValidationMode.Only).BindValue(ref iM01).State;
        }
        #endregion

        #region IM02
        /// <summary>
        /// 即时通讯工具2
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string IM02
        {
            get { return m_IM02; }
            set { m_IM02 = value; }
        }
        private string m_IM02;

        /// <summary>
        /// 即时通讯工具2 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState IM02_Validate(ref string iM02)
        {
            return iM02.Validation("IM02").LengthBetween(0, 300).Text(ValidationMode.Only).BindValue(ref iM02).State;
        }
        #endregion

        #region IM03
        /// <summary>
        /// 即时通讯工具3
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string IM03
        {
            get { return m_IM03; }
            set { m_IM03 = value; }
        }
        private string m_IM03;

        /// <summary>
        /// 即时通讯工具3 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState IM03_Validate(ref string iM03)
        {
            return iM03.Validation("IM03").LengthBetween(0, 300).Text(ValidationMode.Only).BindValue(ref iM03).State;
        }
        #endregion

        #region IM04
        /// <summary>
        /// 即时通讯工具4
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string IM04
        {
            get { return m_IM04; }
            set { m_IM04 = value; }
        }
        private string m_IM04;

        /// <summary>
        /// 即时通讯工具4 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState IM04_Validate(ref string iM04)
        {
            return iM04.Validation("IM04").LengthBetween(0, 300).Text(ValidationMode.Only).BindValue(ref iM04).State;
        }
        #endregion

        #region IM05
        /// <summary>
        /// 即时通讯工具5
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string IM05
        {
            get { return m_IM05; }
            set { m_IM05 = value; }
        }
        private string m_IM05;

        /// <summary>
        /// 即时通讯工具5 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState IM05_Validate(ref string iM05)
        {
            return iM05.Validation("IM05").LengthBetween(0, 300).Text(ValidationMode.Only).BindValue(ref iM05).State;
        }
        #endregion

        #region Address
        /// <summary>
        /// 地址
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Address
        {
            get { return m_Address; }
            set { m_Address = value; }
        }
        private string m_Address;

        /// <summary>
        /// 地址 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Address_Validate(ref string address)
        {
            return address.Validation("Address").LengthBetween(0, 255).Text(ValidationMode.Only).BindValue(ref address).State;
        }
        #endregion

        #region Signature
        /// <summary>
        /// 签名
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Signature
        {
            get { return m_Signature; }
            set { m_Signature = value; }
        }
        private string m_Signature;

        /// <summary>
        /// 签名 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Signature_Validate(ref string signature)
        {
            return signature.Validation("Signature").LengthBetween(0, 16).Text(ValidationMode.Only).BindValue(ref signature).State;
        }
        #endregion

        #region Like
        /// <summary>
        /// 喜好
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Like
        {
            get { return m_Like; }
            set { m_Like = value; }
        }
        private string m_Like;

        /// <summary>
        /// 喜好 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Like_Validate(ref string like)
        {
            return like.Validation("Like").LengthBetween(0, 16).Text(ValidationMode.Only).BindValue(ref like).State;
        }
        #endregion

        #region Intro
        /// <summary>
        /// 自我介绍
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public string Intro
        {
            get { return m_Intro; }
            set { m_Intro = value; }
        }
        private string m_Intro;

        /// <summary>
        /// 自我介绍 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Intro_Validate(ref string intro)
        {
            return intro.Validation("Intro").LengthBetween(0, 16).Text(ValidationMode.Only).BindValue(ref intro).State;
        }
        #endregion

        #region Birthday
        /// <summary>
        /// 生日
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public DateTime Birthday
        {
            get { return m_Birthday; }
            set { m_Birthday = value; }
        }
        private DateTime m_Birthday;

        /// <summary>
        /// 生日 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState Birthday_Validate(ref DateTime birthday)
        {
            return birthday.Validation("Birthday").Between(Pismire.ConstValues.DateTime.MinValue, Pismire.ConstValues.DateTime.MaxValue).State;
        }
        #endregion

        #region UpdateTime
        /// <summary>
        /// 更新时间
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        public DateTime UpdateTime
        {
            get { return m_UpdateTime; }
            set { m_UpdateTime = value; }
        }
        private DateTime m_UpdateTime;

        /// <summary>
        /// 更新时间 正确性验证
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static ExcuteState UpdateTime_Validate(ref DateTime updateTime)
        {
            return updateTime.Validation("UpdateTime").Between(Pismire.ConstValues.DateTime.MinValue, Pismire.ConstValues.DateTime.MaxValue).State;
        }
        #endregion


        #region IDBComponent Members

        /// <summary>
        /// 检查该实体的所有属性是否合法
        /// </summary>
        /// <returns></returns>
        public override ExcuteState CheckMe()
        {
            ExcuteState state = new ExcuteState();

            state = UserProviderName_Validate(ref this.m_UserProviderName);
            if (!state.Succeed) { return state; }
            state = UserProviderKey_Validate(ref this.m_UserProviderKey);
            if (!state.Succeed) { return state; }
            state = NickName_Validate(ref this.m_NickName);
            if (!state.Succeed) { return state; }
            state = RealName_Validate(ref this.m_RealName);
            if (!state.Succeed) { return state; }
            state = Exp_Validate(ref this.m_Exp);
            if (!state.Succeed) { return state; }
            state = Score_Validate(ref this.m_Score);
            if (!state.Succeed) { return state; }
            state = Work_Validate(ref this.m_Work);
            if (!state.Succeed) { return state; }
            state = Face_Validate(ref this.m_Face);
            if (!state.Succeed) { return state; }
            state = Photo_Validate(ref this.m_Photo);
            if (!state.Succeed) { return state; }
            state = Phone_Validate(ref this.m_Phone);
            if (!state.Succeed) { return state; }
            state = Mobile_Validate(ref this.m_Mobile);
            if (!state.Succeed) { return state; }
            state = IM01_Validate(ref this.m_IM01);
            if (!state.Succeed) { return state; }
            state = IM02_Validate(ref this.m_IM02);
            if (!state.Succeed) { return state; }
            state = IM03_Validate(ref this.m_IM03);
            if (!state.Succeed) { return state; }
            state = IM04_Validate(ref this.m_IM04);
            if (!state.Succeed) { return state; }
            state = IM05_Validate(ref this.m_IM05);
            if (!state.Succeed) { return state; }
            state = Address_Validate(ref this.m_Address);
            if (!state.Succeed) { return state; }
            state = Signature_Validate(ref this.m_Signature);
            if (!state.Succeed) { return state; }
            state = Like_Validate(ref this.m_Like);
            if (!state.Succeed) { return state; }
            state = Intro_Validate(ref this.m_Intro);
            if (!state.Succeed) { return state; }
            state = Birthday_Validate(ref this.m_Birthday);
            if (!state.Succeed) { return state; }
            state = UpdateTime_Validate(ref this.m_UpdateTime);
            if (!state.Succeed) { return state; }

            return state;
        }

        #endregion
    }
}
